@use '../helpers/baseMixin.scss';

.vxe-drawer--wrapper {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  line-height: 1.5;
  width: calc(100% + 18px);
  height: calc(100% + 18px);
  color: var(--vxe-ui-font-color);
  font-family: var(--vxe-ui-font-family);
  outline: 0;
  &.is--active {
    display: block;
  }
  &.is--visible {
    &.is--mask {
      &:before {
        background-color: rgba(0, 0, 0, 0.5);
      }
    }
    &.pos--left {
      .vxe-drawer--box {
        left: 0;
      }
    }
    &.pos--right {
      .vxe-drawer--box {
        right: 0;
      }
    }
    &.pos--top {
      .vxe-drawer--box {
        top: 0;
      }
    }
    &.pos--bottom {
      .vxe-drawer--box {
        bottom: 0;
      }
    }
    .vxe-drawer--box {
      opacity: 1;
    }
  }
  &:not(.lock--view) {
    pointer-events: none;
  }
  &.lock--scroll {
    overflow: hidden;
  }
  &:not(.lock--scroll) {
    overflow: auto;
  }
  &.lock--view,
  &.is--mask {
    &:before {
      content: "";
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
      pointer-events: auto;
    }
  }
  &.is--mask {
    &:before {
      background-color: rgba(0, 0, 0, 0);
      @include baseMixin.createAnimationTransition(background-color, 0.2s);
    }
  }
  &.pos--left {
    .vxe-drawer--box {
      top: 0;
      left: -100%;
      box-shadow: 2px 0 10px 0 rgba(0, 0, 0, 0.2);
    }
  }
  &.pos--right {
    .vxe-drawer--box {
      top: 0;
      right: -100%;
      box-shadow: -2px 0 10px 0 rgba(0, 0, 0, 0.2);
    }
  }
  &.pos--top {
    .vxe-drawer--box {
      top: -100%;
      left: 0;
      box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.2);
    }
  }
  &.pos--bottom {
    .vxe-drawer--box {
      bottom: -100%;
      left: 0;
      box-shadow: 0 -2px 10px 0 rgba(0, 0, 0, 0.2);
    }
  }
  &.pos--left,
  &.pos--right {
    .vxe-drawer--box {
      width: 30%;
      height: 100%;
    }
  }
  &.pos--top,
  &.pos--bottom {
    .vxe-drawer--box {
      width: 100%;
      height: 30%;
    }
  }
  &.is--padding {
    .vxe-drawer--body-default {
      padding: 0.8em 0.6em;
      .vxe-drawer--status-wrapper {
        padding-right: 0.6em;
      }
    }
  }
}
.vxe-drawer--box {
  display: flex;
  flex-direction: row;
  position: fixed;
  background-color: var(--vxe-ui-layout-background-color);
  border: 1px solid var(--vxe-ui-base-popup-border-color);
  text-align: left;
  pointer-events: auto;
  opacity: 0;
  @include baseMixin.createAnimationTransition(all, 0.3s);
  &.is--drag {
    cursor: move;
    transition: none;
   .vxe-modal--body,
   .vxe-modal--footer {
      &:after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
      }
    }
    .vxe-modal--body {
      overflow: hidden;
      .vxe-modal--content {
        overflow: hidden;
      }
    }
  }
}
.vxe-drawer--aside {
  flex-shrink: 0;
  overflow: auto;
  outline: 0;
}
.vxe-drawer--container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: auto;
  outline: 0;
}
.vxe-drawer--content {
  flex-grow: 1;
  white-space: pre-line;
}
.vxe-drawer--header,
.vxe-drawer--body,
.vxe-drawer--footer {
  position: relative;
}
.vxe-drawer--body {
  display: flex;
  flex-grow: 1;
  overflow: auto;
  outline: 0;
  .vxe-drawer--content {
    overflow: auto;
  }
}
.vxe-drawer--body-left,
.vxe-drawer--body-right {
  flex-shrink: 0;
  overflow: auto;
  outline: 0;
}
.vxe-drawer--body-default {
  display: flex;
  flex-grow: 1;
  overflow: auto;
  outline: 0;
}
.vxe-drawer--header {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  font-size: 1.1em;
  font-weight: 700;
  border-bottom: 1px solid var(--vxe-ui-base-popup-border-color);
  &.is--ellipsis {
    .vxe-drawer--header-title {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }
}
.vxe-drawer--header-title {
  flex-grow: 1;
  padding: 0.6em 0 0.6em 1em;
}
.vxe-drawer--header-right {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  padding: 0.6em 1em 0.6em 0;
}
.vxe-drawer--footer-wrapper {
  display: flex;
  flex-direction: row;
  .vxe-drawer--footer-left {
    flex-grow: 1;
    text-align: left
  }
  .vxe-drawer--footer-right {
    flex-shrink: 0;
  }
}
.vxe-drawer--close-btn {
  cursor: pointer;
  margin-left: 0.6em;
  &:hover {
    color: var(--vxe-ui-font-primary-color);
  }
}
.vxe-drawer--footer {
  flex-shrink: 0;
  text-align: right;
  padding: 0.4em 1em 0.8em 1em;
}

.vxe-drawer--resize {
  $SpaceSize: 8px;
  $SpaceWidth: 5px;
  .wl-resize,
  .wr-resize,
  .st-resize,
  .sb-resize {
    position: absolute;
    z-index: 100;
  }
  .wl-resize,
  .wr-resize {
    width: $SpaceSize;
    height: 100%;
    top: 0;
    cursor: w-resize;
  }
  .wl-resize {
    left: -$SpaceWidth;
  }
  .wr-resize {
    right: -$SpaceWidth;
  }
  .st-resize,
  .sb-resize {
    width: 100%;
    height: $SpaceSize;
    left: 0;
    cursor: s-resize;
  }
  .st-resize {
    top: -$SpaceWidth;
  }
  .sb-resize {
    bottom: -$SpaceWidth;
  }
}

.vxe-drawer--wrapper {
  font-size: var(--vxe-ui-font-size-default);
  &.size--medium {
    font-size: var(--vxe-ui-font-size-medium);
  }
  &.size--small {
    font-size: var(--vxe-ui-font-size-small);
  }
  &.size--mini {
    font-size: var(--vxe-ui-font-size-mini);
  }
}